#ifndef V2_NIM_NOTIFICATION_SERVICE_H
#define V2_NIM_NOTIFICATION_SERVICE_H
#include "v2_nim_internal.hpp"
namespace v2 {
/// @brief 通知服务
/// @pre
/// 调用 `V2NIMClient::get()` 拿到 client 实例
/// 调用 `client.getNotificationService()` 拿到 notificationService 实例
/// @par 示例代码
/// @code
/// auto& client = V2NIMClient::get();
/// auto& notificationService = client.getNotificationService();
/// @endcode
class V2NIMNotificationService {
public:
    /// @brief 发送自定义通知
    /// @param conversationId 会话 ID
    /// @param content 通知内容
    /// @param params 发送通知相关配置参数
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// auto conversationId = V2NIMConversationIdUtil::p2pConversationId("target_account_id");
    /// V2NIMSendCustomNotificationParams params;
    /// notificationService.sendCustomNotification(
    ///     conversationId,
    ///     "hello world",
    ///     params,
    ///     []() {
    ///         // send notification succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // send notification failed
    ///     });
    /// @endcode
    virtual void sendCustomNotification(nstd::string conversationId,
        nstd::string content,
        V2NIMSendCustomNotificationParams params,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 添加通知监听器
    /// @param listener 通知监听器
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMNotificationListener listener;
    /// listener.onReceiveCustomNotifications = [](nstd::vector<V2NIMCustomNotification> customNotifications) {
    ///     // handle custom notifications
    /// };
    /// listener.onReceiveBroadcastNotifications = [](nstd::vector<V2NIMBroadcastNotification> broadcastNotifications) {
    ///     // handle broadcast notifications
    /// };
    /// notificationService.addNotificationListener(listener);
    /// @endcode
    virtual void addNotificationListener(V2NIMNotificationListener listener) = 0;

    /// @brief 移除通知监听器
    /// @param listener 通知监听器
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMNotificationListener listener;
    /// // ...
    /// conversationService.addNotificationListener(listener);
    /// // ...
    /// conversationService.removeNotificationListener(listener);
    /// @endcode
    virtual void removeNotificationListener(V2NIMNotificationListener listener) = 0;
};
}  // namespace v2
#endif